package sb.de.advanceShopper.activities;


import sb.de.advanceShopper.R;
import sb.de.advanceShopper.dataBase.CitiesDataSource;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class AddCityActivity extends Activity {
	
	private CitiesDataSource citiesDS;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
		
	    citiesDS = new CitiesDataSource(this);
		citiesDS.open();
	}

	@Override
	protected void onResume() {
		citiesDS.open();
		super.onResume();
	}

	@Override
	protected void onPause() {
		citiesDS.close();
		super.onPause();
	}

	@Override
	protected void onDestroy() {
		citiesDS.close();
		super.onDestroy();
	}

	@Override
	protected void onStop() {
		citiesDS.close();
		super.onStop();
	}

	public void addCity(View v) {
		String name = ((EditText) findViewById(R.id.editText1)).getText()
				.toString();
		// City city = (City) ((Spinner) findViewById(R.id.spinner2))
		// .getSelectedItem();
		// String description = ((EditText) findViewById(R.id.editText3))
		// .getText().toString();
		// ds.createShop(name, city, description);
	}

}
